// ClientResources.cs
//
// Copyright (c) 2009 Mike Strobel
//
// This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
// For details, see <http://www.opensource.org/licenses/ms-rl.html>.
//
// All other rights reserved.

using System;
using System.Windows;

using Supremacy.Annotations;

namespace Supremacy.Client
{
    public static class ClientResources
    {
        #region HeaderFontFamily Resource Key
        private static ComponentResourceKey _headerFontFamilyKey;

        public static ComponentResourceKey HeaderFontFamilyKey
        {
            get
            {
                EnsureResource("HeaderFontFamily", ref _headerFontFamilyKey);
                return _headerFontFamilyKey;
            }
        }
        #endregion
        
        #region DefaultFontFamily Resource Key
        private static ComponentResourceKey _defaultFontFamilyKey;

        public static ComponentResourceKey DefaultFontFamilyKey
        {
            get
            {
                EnsureResource("DefaultFontFamily", ref _defaultFontFamilyKey);
                return _defaultFontFamilyKey;
            }
        }
        #endregion

        #region HeaderFontSize Resource Key
        private static ComponentResourceKey _headerFontSizeKey;

        public static ComponentResourceKey HeaderFontSizeKey
        {
            get
            {
                EnsureResource("HeaderFontSize", ref _headerFontSizeKey);
                return _headerFontSizeKey;
            }
        }
        #endregion

        #region DefaultFontSize Resource Key
        private static ComponentResourceKey _defaultFontSizeKey;

        public static ComponentResourceKey DefaultFontSizeKey
        {
            get
            {
                EnsureResource("DefaultFontSize", ref _defaultFontSizeKey);
                return _defaultFontSizeKey;
            }
        }
        #endregion

        #region HeaderFontWeight Resource Key
        private static ComponentResourceKey _headerFontWeightKey;

        public static ComponentResourceKey HeaderFontWeightKey
        {
            get
            {
                EnsureResource("HeaderFontWeight", ref _headerFontWeightKey);
                return _headerFontWeightKey;
            }
        }
        #endregion

        #region DefaultFontWeight Resource Key
        private static ComponentResourceKey _defaultFontWeightKey;

        public static ComponentResourceKey DefaultFontWeightKey
        {
            get
            {
                EnsureResource("DefaultFontWeight", ref _defaultFontWeightKey);
                return _defaultFontWeightKey;
            }
        }
        #endregion

        #region ControlTextForegroundBrush Resource Key
        private static ComponentResourceKey _controlTextForegroundBrushKey;

        public static ComponentResourceKey ControlTextForegroundBrushKey
        {
            get
            {
                EnsureResource("ControlTextForegroundBrush", ref _controlTextForegroundBrushKey);
                return _controlTextForegroundBrushKey;
            }
        }
        #endregion

        #region HeaderTextForegroundBrush Resource Key
        private static ComponentResourceKey _headerTextForegroundBrushKey;

        public static ComponentResourceKey HeaderTextForegroundBrushKey
        {
            get
            {
                EnsureResource("HeaderTextForegroundBrush", ref _headerTextForegroundBrushKey);
                return _headerTextForegroundBrushKey;
            }
        }
        #endregion

        #region DefaultTextForegroundBrush Resource Key
        private static ComponentResourceKey _defaultTextForegroundBrushKey;

        public static ComponentResourceKey DefaultTextForegroundBrushKey
        {
            get
            {
                EnsureResource("DefaultTextForegroundBrush", ref _defaultTextForegroundBrushKey);
                return _defaultTextForegroundBrushKey;
            }
        }
        #endregion

        #region DisabledTextForegroundBrush Resource Key
        private static ComponentResourceKey _disabledTextForegroundBrushKey;

        public static ComponentResourceKey DisabledTextForegroundBrushKey
        {
            get
            {
                EnsureResource("DisabledTextForegroundBrush", ref _disabledTextForegroundBrushKey);
                return _disabledTextForegroundBrushKey;
            }
        }
        #endregion

        #region AlertTextForegroundBrush Resource Key
        private static ComponentResourceKey _alertTextForegroundBrushKey;

        public static ComponentResourceKey AlertTextForegroundBrushKey
        {
            get
            {
                EnsureResource("AlertTextForegroundBrush", ref _alertTextForegroundBrushKey);
                return _alertTextForegroundBrushKey;
            }
        }
        #endregion

        #region HighlightBrush Resource Key
        private static ComponentResourceKey _highlightBrushKey;

        public static ComponentResourceKey HighlightBrushKey
        {
            get
            {
                EnsureResource("HighlightBrush", ref _highlightBrushKey);
                return _highlightBrushKey;
            }
        }
        #endregion

        #region InactiveHighlightBrush Resource Key
        private static ComponentResourceKey _inactiveHighlightBrushKey;

        public static ComponentResourceKey InactiveHighlightBrushKey
        {
            get
            {
                EnsureResource("InactiveHighlightBrush", ref _inactiveHighlightBrushKey);
                return _inactiveHighlightBrushKey;
            }
        }
        #endregion

        #region HorizontalSeparatorBackgroundBrush Resource Key
        private static ComponentResourceKey _horizontalSeparatorBackgroundBrushKey;

        public static ComponentResourceKey HorizontalSeparatorBackgroundBrushKey
        {
            get
            {
                EnsureResource("HorizontalSeparatorBackgroundBrush", ref _horizontalSeparatorBackgroundBrushKey);
                return _horizontalSeparatorBackgroundBrushKey;
            }
        }
        #endregion

        #region VerticalSeparatorBackgroundBrush Resource Key
        private static ComponentResourceKey _verticalSeparatorBackgroundBrushKey;

        public static ComponentResourceKey VerticalSeparatorBackgroundBrushKey
        {
            get
            {
                EnsureResource("VerticalSeparatorBackgroundBrush", ref _verticalSeparatorBackgroundBrushKey);
                return _verticalSeparatorBackgroundBrushKey;
            }
        }
        #endregion

        #region MessageDialogButtonStyle Resource Key
        private static ComponentResourceKey _messageDialogButtonStyleKey;

        public static ComponentResourceKey MessageDialogButtonStyleKey
        {
            get
            {
                EnsureResource("MessageDialogButtonStyle", ref _messageDialogButtonStyleKey);
                return _messageDialogButtonStyleKey;
            }
        }
        #endregion

        #region DialogContainerStyle Resource Key
        private static ComponentResourceKey _dialogContainerStyleKey;

        public static ComponentResourceKey DialogContainerStyleKey
        {
            get
            {
                EnsureResource("DialogContainerStyle", ref _dialogContainerStyleKey);
                return _dialogContainerStyleKey;
            }
        }
        #endregion

        private static void EnsureResource([NotNull] string resourceName, ref ComponentResourceKey resourceKey)
        {
            if (string.IsNullOrEmpty(resourceName))
                throw new ArgumentException("Argument cannot be null or empty.", "resourceName");
            if (resourceKey != null)
                return;
            resourceKey = new ComponentResourceKey(typeof(ClientResources), resourceName);
        }
    }
}